package cn.arikeky.org.enu;

import lombok.AllArgsConstructor;
import lombok.Getter;

import javax.swing.plaf.nimbus.State;
import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ShopStateEum {

    WAIT_AUDIT(0,"待审核"),
    HAVE_AUDIT(1,"已审核"),
    REJECT(-1,"驳回"),
    PASS(2,"已激活");

    private int code;
    private String name;

    public static String getNameByCode(Integer code){
        ShopStateEum stateEum = Arrays.stream(ShopStateEum.values()).filter(state -> state.getCode() == code).findAny().orElse(null);

        return null == stateEum?"":stateEum.getName();
    }

}
